Optimal. Leaf size=69 \[ a^3 B x+\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^3}{3 d}-\frac {2 a^5 B \cos (c+d x)}{d \left (a^2-a^2 \sin (c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {2934, 2749,
2759, 8} \begin {gather*} a^3 B x-\frac {2 a^5 B \cos (c+d x)}{d \left (a^2-a^2 \sin (c+d x)\right )}+\frac {(A+B) \sec ^3(c+d x) (a \sin (c+d x)+a)^3}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2749
Rule 2759
Rule 2934
Rubi steps
\begin {align*} \int \sec ^4(c+d x) (a+a \sin (c+d x))^3 (A+B \sin (c+d x)) \, dx &=\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^3}{3 d}-(a B) \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx\\ &=\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^3}{3 d}-\left (a^5 B\right ) \int \frac {\cos ^2(c+d x)}{(a-a \sin (c+d x))^2} \, dx\\ &=\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^3}{3 d}-\frac {2 a^5 B \cos (c+d x)}{d \left (a^2-a^2 \sin (c+d x)\right )}+\left (a^3 B\right ) \int 1 \, dx\\ &=a^3 B x+\frac {(A+B) \sec ^3(c+d x) (a+a \sin (c+d x))^3}{3 d}-\frac {2 a^5 B \cos (c+d x)}{d \left (a^2-a^2 \sin (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.85, size = 121, normalized size = 1.75 \begin {gather*} -\frac {a^3 \left (-3 (2 A+3 B (2+c+d x)) \cos \left (\frac {1}{2} (c+d x)\right )+(2 A+B (14+3 c+3 d x)) \cos \left (\frac {3}{2} (c+d x)\right )+6 B (2 (2+c+d x)+(c+d x) \cos (c+d x)) \sin \left (\frac {1}{2} (c+d x)\right )\right )}{6 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(247\) vs.
\(2(67)=134\).
time = 0.26, size = 248, normalized size = 3.59
method | result | size |
risch | \(a^{3} B x -\frac {2 \left (3 A \,a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-12 i B \,a^{3} {\mathrm e}^{i \left (d x +c \right )}+9 B \,a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-a^{3} A -7 B \,a^{3}\right )}{3 \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} d}\) | \(86\) |
derivativedivides | \(\frac {-a^{3} A \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+\frac {B \,a^{3}}{3 \cos \left (d x +c \right )^{3}}+\frac {a^{3} A}{\cos \left (d x +c \right )^{3}}+\frac {B \,a^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{\cos \left (d x +c \right )^{3}}+\frac {a^{3} A \left (\sin ^{3}\left (d x +c \right )\right )}{\cos \left (d x +c \right )^{3}}+3 B \,a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+a^{3} A \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+B \,a^{3} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) | \(248\) |
default | \(\frac {-a^{3} A \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+\frac {B \,a^{3}}{3 \cos \left (d x +c \right )^{3}}+\frac {a^{3} A}{\cos \left (d x +c \right )^{3}}+\frac {B \,a^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{\cos \left (d x +c \right )^{3}}+\frac {a^{3} A \left (\sin ^{3}\left (d x +c \right )\right )}{\cos \left (d x +c \right )^{3}}+3 B \,a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+a^{3} A \left (\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{4}\left (d x +c \right )}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}\right )+B \,a^{3} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) | \(248\) |
norman | \(\frac {\frac {\left (6 a^{3} A +2 B \,a^{3}\right ) \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+a^{3} B x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a^{3} B x \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {20 a^{3} A -4 B \,a^{3}}{3 d}-a^{3} B x -\frac {\left (8 a^{3} A +24 B \,a^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (38 a^{3} A +2 B \,a^{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {\left (46 a^{3} A +26 B \,a^{3}\right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (98 a^{3} A +182 B \,a^{3}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {\left (212 a^{3} A +188 B \,a^{3}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-a^{3} B x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 a^{3} B x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 a^{3} B x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 a^{3} B x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 a^{3} B x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {2 a^{3} \left (A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 a^{3} \left (A -B \right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {8 a^{3} \left (7 A +9 B \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{3} \left (11 A +5 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {4 a^{3} \left (11 A +5 B \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 a^{3} \left (61 A +67 B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 a^{3} \left (61 A +67 B \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) | \(531\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 164 vs.
\(2 (68) = 136\).
time = 0.51, size = 164, normalized size = 2.38 \begin {gather*} \frac {3 \, A a^{3} \tan \left (d x + c\right )^{3} + 3 \, B a^{3} \tan \left (d x + c\right )^{3} + {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a^{3} + {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} B a^{3} - \frac {{\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} A a^{3}}{\cos \left (d x + c\right )^{3}} - \frac {3 \, {\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} B a^{3}}{\cos \left (d x + c\right )^{3}} + \frac {3 \, A a^{3}}{\cos \left (d x + c\right )^{3}} + \frac {B a^{3}}{\cos \left (d x + c\right )^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 167 vs.
\(2 (68) = 136\).
time = 0.37, size = 167, normalized size = 2.42 \begin {gather*} -\frac {6 \, B a^{3} d x + 2 \, {\left (A + B\right )} a^{3} - {\left (3 \, B a^{3} d x + {\left (A + 7 \, B\right )} a^{3}\right )} \cos \left (d x + c\right )^{2} + {\left (3 \, B a^{3} d x + {\left (A - 5 \, B\right )} a^{3}\right )} \cos \left (d x + c\right ) - {\left (6 \, B a^{3} d x - 2 \, {\left (A + B\right )} a^{3} + {\left (3 \, B a^{3} d x - {\left (A + 7 \, B\right )} a^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} - d \cos \left (d x + c\right ) + {\left (d \cos \left (d x + c\right ) + 2 \, d\right )} \sin \left (d x + c\right ) - 2 \, d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 93, normalized size = 1.35 \begin {gather*} \frac {3 \, {\left (d x + c\right )} B a^{3} - \frac {2 \, {\left (3 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + A a^{3} - 5 \, B a^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.81, size = 140, normalized size = 2.03 \begin {gather*} B\,a^3\,x-\frac {\frac {a^3\,\left (2\,A-10\,B+3\,B\,\left (c+d\,x\right )\right )}{3}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^3\,\left (6\,A-6\,B+9\,B\,\left (c+d\,x\right )\right )}{3}-3\,B\,a^3\,\left (c+d\,x\right )\right )+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a^3\,\left (24\,B-9\,B\,\left (c+d\,x\right )\right )}{3}+3\,B\,a^3\,\left (c+d\,x\right )\right )-B\,a^3\,\left (c+d\,x\right )}{d\,{\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________